<div class="form-cont" ng-switch on="vm.type">
    <form name="postForm" class="form system-form-cont" novalidate ng-switch-when="post">
        <div class="modal-header">
            <h4 class="modal-title">
                <span ng-if="vm.isEdit">岗位编辑</span>
                <span ng-if="!vm.isEdit">基本资料</span>
            </h4>
        </div>
        <div class="modal-body">
            <div class="form-group height-60">
                <label for="sysPostCode">系统岗位编码<span class="require"></span></label>
                <input type="text" id="sysPostCode" name="sysPostCode" class="form-control" ng-class="{error: postForm.sysPostCode.$invalid && !postForm.sysPostCode.$pristine}" ng-blur="vm.checkValid(postForm.sysPostCode)" ng-model="vm.data.sysPostCode" required placeholder="系统岗位编码">
                <span class="error" ng-show="postForm.sysPostCode.$invalid && !postForm.sysPostCode.$pristine">岗位编码不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="sysPostName">系统岗位名称<span class="require"></span></label>
                <input type="text" id="sysPostName" name="sysPostName" class="form-control" ng-class="{error: postForm.sysPostName.$invalid && !postForm.sysPostName.$pristine}" ng-blur="vm.checkValid(postForm.sysPostName)" ng-model="vm.data.sysPostName" required placeholder="系统岗位名称">
                <span class="error" ng-show="postForm.sysPostName.$invalid && !postForm.sysPostName.$pristine">岗位名称不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="statusCd">岗位状态<span class="require"></span></label>
                <select name="statusCd" ng-model="vm.data.statusCd" ng-change="vm.checkValid(postForm.statusCd)" ng-class="{error: postForm.statusCd.$invalid && !postForm.statusCd.$pristine}" ng-options="k as v for (k,v) in vm.select.status" required id="statusCd" class="form-control">
                    <option value="">请选岗位状态</option>
                </select>
                <span class="error" ng-show="postForm.statusCd.$invalid && !postForm.statusCd.$pristine">岗位状态不能为空</span>
            </div>
            <div class="form-group">
                <label for="sysPostDesc">岗位描述</label>
                <textarea class="form-control" id="sysPostDesc" ng-model="vm.data.sysPostDesc" cols="30" rows="5" placeholder="岗位描述"></textarea>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary btn-xl" ng-disabled="postForm.$invalid" ng-click="vm.save('post')"><span ng-if="vm.submitting"><i class="fa fa-spin fa-spinner"></i></span>保存</button>
            <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
        </div>
    </form>
    <form name="userForm" class="form system-form-cont" novalidate ng-switch-when="user">
        <div class="modal-header">
            <h4 class="modal-title">
                <span ng-if="vm.isEdit">用户编辑</span>
                <span ng-if="!vm.isEdit">基本资料</span>
            </h4>
        </div>
        <div class="modal-body">
            <!-- <input type="hidden" ng-model="vm.data.staffId" ng-if="vm.isEdit"> -->
            <input type="hidden" ng-model="vm.data.sysUserId" ng-if="vm.isEdit">
            <div class="form-group height-60" ng-if="!vm.isEdit">
                <label for="staffName">员工名称</label>
                <input type="text" id="staffName" name="staffId" class="form-control" disabled ng-model="vm.data.staffName">
                <input type="hidden" id="staffId" name="staffId" class="form-control" ng-model="vm.data.staffId">
            </div>
            <div class="form-group height-60">
                <label for="sysUserCode">用户账号<span class="require"></span></label>
                <input ng-if="vm.isEdit" type="text" id="sysUserCode" name="sysUserCode" class="form-control" disabled ng-model="vm.data.sysUserCode" placeholder="用户账号">
                <input ng-if="!vm.isEdit" type="text" id="sysUserCode" name="sysUserCode" class="form-control" ng-class="{'error': userForm.sysUserCode.$invalid && !userForm.sysUserCode.$pristine}" ng-blur="vm.checkValid(userForm.sysUserCode)" ng-model="vm.data.sysUserCode" placeholder="用户账号" required>
                <span ng-if="!vm.isEdit" class="error" ng-show="userForm.sysUserCode.$invalid && !userForm.sysUserCode.$pristine">用户账号不能为空</span>
            </div>
            <div class="form-group height-60" ng-if="!vm.isEdit">
                <label for="password">初始密码</label>
                <input type="text" id="password" name="password" class="form-control" ng-model="vm.data.password">
            </div>
            <div class="form-group height-60" ng-if="vm.isEdit">
                <label for="sysUserCode">密码</label>
                <input type="text" id="password" name="password" class="form-control" ng-model="vm.data.password">
            </div>
            <div class="form-group height-60">
                <label for="statusCd">用户状态<span class="require"></span></label>
                <select name="statusCd" ng-model="vm.data.statusCd" ng-class="{error: userForm.statusCd.$invalid && !userForm.statusCd.$pristine}" ng-options="k as v for (k,v) in vm.select.status" required id="statusCd" class="form-control" >
                    <option value="">请选用户状态</option>
                </select>
                <span class="error" ng-show="userForm.statusCd.$invalid && !userForm.statusCd.$pristine">岗位状态不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="passRuleId">密码策略</label>
                <select name="passRuleId" ng-model="vm.data.passRuleId" ng-class="{error: userForm.passRuleId.$invalid && !userForm.passRuleId.$pristine}" ng-options="v.id as v.name for (k,v) in vm.select.strategy" id="passRuleId" class="form-control" >
                    <option value="">请选密码策略</option>
                </select>
            </div>
            <div class="form-group">
                <div class="checkbox">
                    <label for="passNeedModify">
                        <input type="checkbox" id="passNeedModify" name="passNeedModify" ng-model="vm.data.passNeedModify">下次登录强制修改密码
                    </label>
                </div>
            </div>
            <div class="form-group height-60">
                <label for="sysCode">归属系统</label>
                <select name="sysCode" ng-blur="vm.checkValid(userForm.sysCode)" ng-change="vm.checkValid(userForm.sysCode)" ng-model="vm.data.sysCode" ng-class="{error: userForm.sysCode.$invalid && !userForm.sysCode.$pristine}" ng-options="v.platSysNbr as v.platName for v in vm.select.plats" id="sysCode" class="form-control">
                    <option value="">请选归属系统</option>
                </select>
                <span class="error" ng-show="userForm.sysCode.$invalid && !userForm.sysCode.$pristine">归属系统不能为空</span>
            </div>
            <div class="form-group">
                <label for="sysUserDesc">用户描述</label>
                <textarea class="form-control" id="sysUserDesc" ng-model="vm.data.sysUserDesc" cols="30" rows="5" placeholder="系统用户描述"></textarea>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary" ng-disabled="userForm.$invalid" ng-click="vm.save('user')"><span ng-if="vm.submitting"><i class="fa fa-spin fa-spinner"></i></span>保存</button>
            <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
        </div>
    </form>
    <form name="staffForm" class="form system-form-cont" novalidate ng-switch-when="staff">
        <div class="modal-header">
            <h4 class="modal-title">
                <span ng-if="vm.isEdit">员工编辑</span>
                <span ng-if="!vm.isEdit">基本资料</span>
            </h4>
        </div>
        <div class="modal-body">
            <div class="form-group height-60">
                <label for="staffName">员工名称<span class="require"></span></label>
                <input ng-class="{'error': staffForm.staffName.$invalid && !staffForm.staffName.$pristine}" ng-blur="vm.checkValid(staffForm.staffName)" type="text" id="staffName" name="staffName" class="form-control" ng-model="vm.data.staffName" placeholder="员工名称" required>
                <span class="error" ng-show="staffForm.staffName.$invalid && !staffForm.staffName.$pristine">员工名称不能为空</span>
            </div>
             <div class="form-group height-60">
                <label for="staffId">员工编码<span class="require"></span></label>
                <input ng-if="!vm.isEdit" ng-class="{'error': staffForm.staffCode.$invalid && !staffForm.staffCode.$pristine}" ng-blur="vm.checkValid(staffForm.staffCode)" type="text" id="staffCode" name="staffCode" class="form-control" ng-model="vm.data.staffCode" placeholder="员工账号" required>
                <input ng-if="vm.isEdit" type="text" id="staffCode" name="staffCode" class="form-control" disabled ng-model="vm.data.staffCode" placeholder="员工账号">
                <span ng-if="!vm.isEdit" class="error" ng-show="staffForm.staffCode.$invalid && !staffForm.staffCode.$pristine">员工账号不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="mobilePhone">手机号码</label>
                <input type="tel" size="11" class="form-control" ng-class="{'error': staffForm.mobilePhone.$invalid && !staffForm.mobilePhone.$pristine}" name="mobilePhone" ng-pattern="/^0{0,1}(13[0-9]|15[7-9]|153|156|18[7-9])[0-9]{8}$/" ng-model="vm.data.mobilePhone" id="mobilePhone" placeholder="联系电话" />
                <span class="error" ng-show="staffForm.mobilePhone.$invalid && !staffForm.mobilePhone.$pristine">手机号码格式错误</span>
            </div>
            <div class="form-group height-60">
                <label for="statusCd">员工状态<span class="require"></span></label>
                <select name="statusCd" ng-model="vm.data.statusCd" ng-change="vm.checkValid(staffForm.statusCd)" ng-class="{error: staffForm.statusCd.$invalid && !staffForm.statusCd.$pristine}" ng-options="k as v for (k,v) in vm.select.status" required id="statusCd" class="form-control">
                    <option value="">请选系统用户状态</option>
                </select>
                <span class="error" ng-show="staffForm.statusCd.$invalid && !staffForm.statusCd.$pristine">岗位状态不能为空</span>
            </div>
            <div class="form-group">
                <label for="staffDesc">员工描述</label>
                <textarea class="form-control" id="staffDesc" ng-model="vm.data.staffDesc" cols="30" rows="4" placeholder="员工描述"></textarea>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary btn-xl" ng-disabled="staffForm.$invalid" ng-click="vm.save('staff')"><span ng-if="vm.submitting"><i class="fa fa-spin fa-spinner"></i></span>保存</button>
            <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
        </div>
    </form>
</div>